﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductTypeManagement.ascx.cs" Inherits="admin_webparts_Plug_ins_Product_ProductTypeManagement" %>

<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.Web.BL.Product" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>
<style type="text/css">
    #spLinkAdd, #spBack, #spLinkDelete, #spLinkAddContent, #spLinkView, #spLinkAddPro, #spTypeManage {font-size:1.1em; font-weight: bold; }
    #spLinkAdd button, #spBack button, #spLinkDelete button, #spLinkAddContent button, #spLinkView button, #spLinkAddPro button, #spTypeManage button { font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold; }
</style>
<div class="tip" style="min-height: 22px; overflow: hidden;">
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td align="left">
                <h2 style="padding-top: 2px;"><%=(this._Type == null ? LanguageUtility.GetLanguageText("PRODUCT_GROUP", Session) : this._Type.Name)%></h2>
            </td>
            <td align="right" style="white-space: nowrap;">
                <%if (this._Type != null || this._IsAdminLogged) { %>
                <span id="spLinkAdd" class="yui-button yui-link-button yuibtn yuibtn-icon btnaddf"><span class="first-child"><a href="?action=addtype&g=<%=this.Request.QueryString["g"] %>&typeid=<%=this.Request.QueryString["typeid"] %>"><%=LanguageUtility.GetLanguageText("ADD_SUB_PRO_TYPE", Session)%></a></span></span>
                <%} %>
                <span id="spBack" class="yui-button yui-link-button yuibtn yuibtn-icon btnundo"><span class="first-child"><a href="?action=view&g=<%=this.Request.QueryString["g"] %>&typeid=<%=this.Request.QueryString["typeid"] %>"><%=LanguageUtility.GetLanguageText("BACK", Session)%></a></span></span>
            </td>
        </tr>
    </table>
    <script type="text/javascript">
        YAHOO.util.Event.onDOMReady(function () {
            var spLinkAdd = new YAHOO.widget.Button("spLinkAdd");
            var spBack = new YAHOO.widget.Button("spBack");
        });
    </script>
</div>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="margin-bottom: 10px;">
    <tr>
        <td>Các nhóm con trực thuộc:</td>
    </tr>
</table>

<table id="tbGrid" class="grid" border="1" cellpadding="0" cellspacing="0">
    <tr>
        <th width="42px">#</th>
        <th><%=LanguageUtility.GetLanguageText("NAME", Session)%></th>
        <th><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%></th>
        <th width="42px"><%=LanguageUtility.GetLanguageText("ACTION", Session)%></th>
    </tr>
<%
    if (this._List != null) {
        int typeID = _Type == null ? 0 : _Type.ID;
        for (int i = 0; i < _List.Rows.Count; i++)
        {
            System.Data.DataRow row = _List.Rows[i];
            string id = row[ProductType.ID__COLUMN_NAME].ToString();
            string groupID = row[ProductType.GROUPID__COLUMN_NAME].ToString();
            string name = row[ProductType.NAME__COLUMN_NAME].ToString();
            int actived = (int)row[ProductType.ACTIVED__COLUMN_NAME];
%>
    <tr class="<%=(i%2==1?"even":"odd") %>">
        <td align="center"><%=i + 1 %></td>
        <td><%=name %></td>
        <td align="center"><%=(actived == 1 ? "<img src=\"resources/images/active.png\" />" : "<img src=\"resources/images/inactive.png\" />")%></td>
        <td align="center">
            <ul class="icon" style="width: 112px;">
                <li><a title="<%=LanguageUtility.GetLanguageText("EDIT", Session)%>" href="ProductContent.aspx?action=edittype&g=<%=groupID %>&parentid=<%=typeID %>&typeid=<%=id %>" class="icon editbn">&nbsp</a></li>
                <li><a title="<%=LanguageUtility.GetLanguageText("DELETE", Session)%>" href="ProductContent.aspx?action=deletetype&g=<%=groupID %>&parentid=<%=typeID %>&typeid=<%=id %>" class="icon deletebn" onclick="javascript: return confirm('<%=LanguageUtility.GetLanguageText("CONFIRM_DELETE", Session).Replace("<br />", "\\n")%>');">&nbsp</a></li>
                <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_UP", Session)%>" href="ProductContent.aspx?action=typemoveup&g=<%=groupID %>&parentid=<%=typeID %>&typeid=<%=id %>" class="icon ascbn">&nbsp</a></li>
                <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_DOWN", Session)%>" href="ProductContent.aspx?action=typemovedown&g=<%=groupID %>&parentid=<%=typeID %>&typeid=<%=id %>" class="icon descbn">&nbsp</a></li>
            </ul>
        </td>
    </tr>
<%
        }
    } 
%>
</table>